﻿#include "CmdSaveHeatMapMainSettingData.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdSaveHeatMapMainSettingData::CmdSaveHeatMapMainSettingData()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdSaveHeatMapMainSettingData::~CmdSaveHeatMapMainSettingData()
    {
    }

    bool CmdSaveHeatMapMainSettingData::execute()
    {
        // bool _success = false;
        emit IBaseSignalInstance->signal_saveHeatMapMainSettingData(m_windowId,
                                                                             m_scalarBarIsAutoRange,
                                                                             m_scalarBarMin,
                                                                             m_scalarBarMax,
                                                                             m_scalarBarColor,
                                                                             m_scalarBarFontSize,
                                                                             m_XAxisAutoTitle,
                                                                             m_XAxisTitle,
                                                                             m_XTitleFontColor,
                                                                             m_XTitleFontSize,
                                                                             m_XAxisColor,
                                                                             m_XAisThickness,
                                                                             m_XValuePrecision,
                                                                             m_XAxisDigitColor,
                                                                             m_XAxisDigitSize,
                                                                             m_XAxisIsAutoRange,
                                                                             m_XAxisMax,
                                                                             m_XAxisMin,
                                                                             m_XIsAutoStepSize,
                                                                             m_XCustomStepSize,
                                                                             m_YAxisAutoTitle,
                                                                             m_YAxisTitle,
                                                                             m_YTitleFontColor,
                                                                             m_YTitleFontSize,
                                                                             m_YAxisColor,
                                                                             m_YAisThickness,
                                                                             m_YValuePrecision,
                                                                             m_YAxisDigitColor,
                                                                             m_YAxisDigitSize,
                                                                             m_YAxisIsAutoRange,
                                                                             m_YAxisMax,
                                                                             m_YAxisMin,
                                                                             m_YIsAutoStepSize,
                                                                             m_YCustomStepSize,
                                                                             m_gridIsMainGridLineDisplay,
                                                                             m_gridMainGridLineColor,
                                                                             m_gridMainGridLineStyle,
                                                                             m_gridMainGridLineThickness,
                                                                             m_gridIsSecondaryGridLineDisplay,
                                                                             m_gridSecondaryGridLineColor,
                                                                             m_gridSecondaryGridLineStyle,
                                                                             m_gridSecondaryGridLineThickness,
                                                                             m_windowTitleName,
                                                                             m_windowTitleFontColor,
                                                                             m_windowTitleFontSize);
        return true;
    }

    void CmdSaveHeatMapMainSettingData::undo()
    {
    }

    void CmdSaveHeatMapMainSettingData::redo()
    {
        // execute();
    }

    void CmdSaveHeatMapMainSettingData::setHeatMapMainSettingData(int windowId, bool scalarBarIsAutoRange,
                                                                  double scalarBarMin, double scalarBarMax, QString scalarBarColor, int scalarBarFontSize,
                                                                  bool XAxisAutoTitle, QString XAxisTitle, QString XTitleFontColor, int XTitleFontSize, QString XAxisColor,
                                                                  double XAisThickness, int XValuePrecision, QString XAxisDigitColor, int XAxisDigitSize,
                                                                  bool XAxisIsAutoRange, double XAxisMax, double XAxisMin, bool XIsAutoStepSize, double XCustomStepSize,
                                                                  bool YAxisAutoTitle, QString YAxisTitle, QString YTitleFontColor, int YTitleFontSize, QString YAxisColor,
                                                                  double YAisThickness, int YValuePrecision, QString YAxisDigitColor, int YAxisDigitSize,
                                                                  bool YAxisIsAutoRange, double YAxisMax, double YAxisMin, bool YIsAutoStepSize, double YCustomStepSize,
                                                                  bool gridIsMainGridLineDisplay, QString gridMainGridLineColor, int gridMainGridLineStyle,
                                                                  double gridMainGridLineThickness, bool gridIsSecondaryGridLineDisplay, QString gridSecondaryGridLineColor,
                                                                  int gridSecondaryGridLineStyle, double gridSecondaryGridLineThickness, QString windowTitleName,
                                                                  QString windowTitleFontColor, int windowTitleFontSize)
    {
        m_windowId = windowId;
        m_scalarBarIsAutoRange = scalarBarIsAutoRange;
        m_scalarBarMin = scalarBarMin;
        m_scalarBarMax = scalarBarMax;
        m_scalarBarColor = scalarBarColor;
        m_scalarBarFontSize = scalarBarFontSize;
        m_XAxisAutoTitle = XAxisAutoTitle;
        m_XAxisTitle = XAxisTitle;
        m_XTitleFontColor = XTitleFontColor;
        m_XTitleFontSize = XTitleFontSize;
        m_XAxisColor = XAxisColor;
        m_XAisThickness = XAisThickness;
        m_XValuePrecision = XValuePrecision;
        m_XAxisDigitColor = XAxisDigitColor;
        m_XAxisDigitSize = XAxisDigitSize;
        m_XAxisIsAutoRange = XAxisIsAutoRange;
        m_XAxisMax = XAxisMax;
        m_XAxisMin = XAxisMin;
        m_XIsAutoStepSize = XIsAutoStepSize;
        m_XCustomStepSize = XCustomStepSize;
        m_YAxisAutoTitle = YAxisAutoTitle;
        m_YAxisTitle = YAxisTitle;
        m_YTitleFontColor = YTitleFontColor;
        m_YTitleFontSize = YTitleFontSize;
        m_YAxisColor = YAxisColor;
        m_YAisThickness = YAisThickness;
        m_YValuePrecision = YValuePrecision;
        m_YAxisDigitColor = YAxisDigitColor;
        m_YAxisDigitSize = YAxisDigitSize;
        m_YAxisIsAutoRange = YAxisIsAutoRange;
        m_YAxisMax = YAxisMax;
        m_YAxisMin = YAxisMin;
        m_YIsAutoStepSize = YIsAutoStepSize;
        m_YCustomStepSize = YCustomStepSize;
        m_gridIsMainGridLineDisplay = gridIsMainGridLineDisplay;
        m_gridMainGridLineColor = gridMainGridLineColor;
        m_gridMainGridLineStyle = gridMainGridLineStyle;
        m_gridMainGridLineThickness = gridMainGridLineThickness;
        m_gridIsSecondaryGridLineDisplay = gridIsSecondaryGridLineDisplay;
        m_gridSecondaryGridLineColor = gridSecondaryGridLineColor;
        m_gridSecondaryGridLineStyle = gridSecondaryGridLineStyle;
        m_gridSecondaryGridLineThickness = gridSecondaryGridLineThickness;
        m_windowTitleName = windowTitleName;
        m_windowTitleFontColor = windowTitleFontColor;
        m_windowTitleFontSize = windowTitleFontSize;
    }

} // namespace PostCommand
